package com.tedu.day02.oop;

import java.io.Serializable;

/**
 * 实体类：属性  对应   数据库
 */
public class person implements Serializable {
    public static void main(String[] args) {
        Person p=new Person();
        System.out.println(p.toString());//打印对象地址值  不写：打印引用调toString
    }


    private String name;   //稀有属性
    private int age;
    private  char sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }
    //调取默认构造器
    public person(){
        System.out.println("person.......");

    }
    //程序中：toString()  方法功能：查看属性数据   调取---不用手段

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }
}